package com.example.design_pattern.factory.simple;


import com.example.design_pattern.factory.Pizza;

public class SimplePizzaStore {
    SimplePizzaFactory pizzaFactory;

    public SimplePizzaStore(SimplePizzaFactory pizzaFactory) {
        this.pizzaFactory = pizzaFactory;
    }



    public final Pizza orderPizza(PizzaTypeEnums type){
        Pizza pizza;
        pizza  = pizzaFactory.createPizza(type);
        // 准备
        pizza.prepare();
        // 烘烤
        pizza.bake();
        // 切片
        pizza.cut();
        // 装盒
        pizza.box();
        return pizza;
    }

}
